<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="__PUBLIC__/admin/css/lines.css" rel="stylesheet"
	type="text/css">
	<link href="__PUBLIC__/admin/js/tbox/box.css" rel="stylesheet"
		type="text/css" />
	<script type="text/javascript" src="__PUBLIC__/admin/js/jquery.js"></script>
	<script type="text/javascript" src="__PUBLIC__/admin/js/common.js"></script>
	<script type="text/javascript" src="__PUBLIC__/admin/js/tbox/box.js"></script>
	<title>线路管理</title>
</head>

<body>
	<div class="so_main">
		<div class="page_tit">线路管理</div>
		<div class="Toolbar_inbox">
			<a href="<?php echo U('Admin/addLine');?>" class="btn_a"><span>添加线路</span></a>
		</div>

		<div class="list">
			<table width="100%" id="mytab" border="0" cellspacing="0"
				cellpadding="0">
				<thead>
					<th class="line_l">编号</th>
					<th class="line_l">名称</th>
					<th class="line_l">巡检员</th>
					<th class="line_l">结点个数</th>
					<th class="line_l">操作</th>
				</thead>
				<?php if(is_array($lines)): $i = 0; $__LIST__ = $lines;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr overstyle='on' id="line_<?php echo ($vo['line_id']); ?>">


					<td><?php echo ($vo["line_id"]); ?></td>
					<td><?php echo ($vo["name"]); ?></td>
					<td><?php echo ($vo["inspector"]); ?></td>
					<td><?php echo ($vo["node_amount"]); ?></td>
					<td><a
						href="<?php echo U('Admin/editLine', array('line_id'=>$vo['line_id']));?>">编辑</a>
						&nbsp <a href="javascript:void(0);"
						onclick="deleteLine(<?php echo ($vo['line_id']); ?>);">删除</a> &nbsp <a
						href="<?php echo U('Admin/node', array('line_id'=>$vo['line_id']));?>">节点管理</a>

					</td>
				</tr><?php endforeach; endif; else: echo "" ;endif; ?>
			</table>
		</div>
	</div>
</body>
</html>
<script>
//删除用户
function deleteLine(line_id) {
	line_id = line_id.toString();
	if(line_id == '' || !confirm('删除成功后将无法恢复，确认继续？')) 
		return false;
	
	$.post("<?php echo U('Admin/delectLine');?>", {line_id:line_id}, function(res){
		if(res == '1') {
			/*
			line_id = line_id.split(',');
			for(i = 0; i <line_id .length; i++) {
				$('#line_'+line_id[i]).remove();
			}
			*/
			$('#line_'+line_id).remove();
			ui.success('操作成功');
		}else {
			ui.error('操作失败');
		}
	});
}
</script>